package com.net

import com.helloandroid.ext.parseTaskInfo
import com.helloandroid.ext.process
import org.json.JSONObject
import org.junit.Test

class TestZhuan {


    @Test
    fun test_zhuan(){
        val str = """
            {"err":0,"json":1,"data":"{\"bind_wx\": {\"count\": 0, \"state\": 0}, \"first_tx\": {\"count\": 7, \"state\": 1}, \"daily_bushu\": {\"count\": 0, \"state\": 0}, \"daily_share\": {\"count\": 0, \"state\": 0}, \"daily_sport\": {\"count\": 0, \"state\": 0}, \"daily_video\": {\"count\": 0, \"state\": 0}, \"daily_chifan\": {\"count\": 0, \"state\": 0}, \"daily_heshui\": {\"count\": 0, \"state\": 0}, \"daily_niudan\": {\"count\": 0, \"state\": 0}, \"daily_zaowan\": {\"count\": 0, \"state\": 0}, \"daily_chengyu\": {\"count\": 0, \"state\": 0}, \"daily_hbmatch\": {\"count\": 0, \"state\": 0}, \"daily_zhuanpan\": {\"count\": 0, \"state\": 0}, \"daily_hongbaoyu\": {\"count\": 0, \"state\": 0}}","serverTime":1614136597792}
        """.trimIndent()

        val jsonObj = JSONObject(str)
        val parseResult = jsonObj.process(JSONObject::parseTaskInfo)
        println(parseResult)
    }
}